import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createPinia } from 'pinia'

import {ElMessage} from 'element-plus'

function showMessage(message, type='info',duration=3000) {
  ElMessage({
    showClose: true,
    message,
    type,
    duration
  })
}



//创建Pinia实例
const pinia = createPinia()
//挂载到Vue实例上
const app = createApp(App)

app.config.globalProperties.$message = showMessage

app.use(router)
app.use(ElementPlus)
app.use(pinia)

app.mount('#app')
